<!DOCTYPE html>
<html>
<head>
    <#assign secSelect = JspTaglibs["http://www.casic304.cn/secSelect"] />
    <#assign fillDept=JspTaglibs["http://www.casic304.cn/fillDept"] />
    <#assign dicSelect = JspTaglibs["http://www.casic304.cn/dicSelect"]/>
    <meta charset="utf-8">
    <title>紧固件</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="${ctx}/layui/css/layui.css" media="all"/>
    <link rel="stylesheet" href="${ctx}/qbdmsStatic/iconfont/iconfont.css"/>
    <link rel="stylesheet" href="${ctx}/qbdmsStatic/style/qbdms.css">
    <link rel="stylesheet" href="${ctx}/qbdmsStatic/style/forms/currencyCss.css">
    <script type="text/javascript">
        var __ctx = "${ctx}";
    </script>
    <style>
        .qbdms-TBinformation{margin-left: 0px;}
        .qbdms-TBinformationText{margin-left: 145px;}
    </style>
</head>
<body class="listBody">
<div class="qbdms-bodyDiv">
    <div class="qbdms-backDiv">
        <div class="layui-table-view-body" style="padding: 0 24px 24px;">
            <div class="qbdms-formTitle" style="border-bottom: 1px solid #E5F0FF">紧固件 <i class="qbdms-returnOn closeWindow">返回</i></div>
            <form class="layui-form treeFormPreview"  requrl="${ctx}/qbdms/wQbdFastenerInformation/get"
                  lay-filter="wQbdFastenerInformationDataForm">
                <@fillDept.dept id="tbxx"/>
                <div class="layui-row">
                    <div style="width: 42%">
                        <label class="layui-form-label qbdms-label" title="密级">密级<span style="color: red;">*</span></label>
                        <div class="layui-input-block qbdms-input">
                            <@secSelect.sec_select data_src=1 required=true name="secret"/>
                        </div>
                    </div>
                    <div style="width: 42%">
                        <label class="layui-form-label qbdms-label"  title="检验项名称">检验项名称<span style="color: red;">*</span></label>
                        <div class="layui-input-block qbdms-input">
                            <select name="inspectionItemName" lay-verify="required" lay-reqtext="检验项名称是必填项"
                                    lay-filter="inspectionItemName" maxlength="50"></select>
                        </div>
                    </div>
                    <div style="width: 42%">
                        <label class="layui-form-label qbdms-label"  title="检测时间">检测时间<span style="color: red;">*</span></label>
                        <div class="layui-input-block qbdms-input">
                            <input type="text" name="detectionTime"  placeholder="请输入"
                                   autocomplete="off" class="layui-input dateTimeFiled input-right time-init" readonly
                                   maxlength="50" fieldname="detectionTime"  lay-verify="required" lay-reqtext="检测时间是必填项">
                        </div>
                    </div>
                    <div style="width: 42%">
                        <label class="layui-form-label qbdms-label"  title="生产企业类别">生产企业类别<span style="color: red;">*</span></label>
                        <div class="layui-input-block qbdms-input">
                            <@dicSelect.dic name="productionEnterpriseCategory" nodeKey="scqylb" verify="required" reqtext="生产企业类别是必填项"/>
                        </div>
                    </div>

                    <div style="width: 76%">
                        <label class="layui-form-label qbdms-label"  title="产品名称">产品名称<span style="color: red;">*</span></label>
                        <div class="layui-input-block qbdms-input">
                            <input type="text" name="productName"  placeholder="请输入"
                                   autocomplete="off" class="layui-input textInput" lay-verify="required" lay-reqtext="产品名称是必填项"
                                   maxlength="50" fieldname="productName">
                        </div>
                    </div>
                    <div style="width: 76%">
                        <label class="layui-form-label qbdms-label"  title="产品标准">产品标准</label>
                        <div class="layui-input-block qbdms-input">
                            <input type="text" name="productStandards"  placeholder="请输入"
                                   autocomplete="off" class="layui-input textInput"
                                   maxlength="50" fieldname="productStandards">
                        </div>
                    </div>
                    <div style="width: 76%">
                        <label class="layui-form-label qbdms-label"  title="规格型号">规格型号</label>
                        <div class="layui-input-block qbdms-input">
                            <input type="text" name="specificationModel"  placeholder="请输入"
                                   autocomplete="off" class="layui-input textInput"
                                   maxlength="50" fieldname="specificationModel">
                        </div>
                    </div>
                    <div style="width: 76%">
                        <label class="layui-form-label qbdms-label"  title="材料/性能等级">材料/性能等级</label>
                        <div class="layui-input-block qbdms-input">
                            <input type="text" name="performanceLevel"  placeholder="请输入"
                                   autocomplete="off" class="layui-input textInput"
                                   maxlength="50" fieldname="performanceLevel">
                        </div>
                    </div>
                    <div style="width: 76%">
                        <label class="layui-form-label qbdms-label"  title="检测标准">检测标准</label>
                        <div class="layui-input-block qbdms-input">
                            <input type="text" name="testingStandards"  placeholder="请输入"
                                   autocomplete="off" class="layui-input textInput"
                                   maxlength="50" fieldname="testingStandards">
                        </div>
                    </div>
                    <div style="width: 76%">
                        <label class="layui-form-label qbdms-label"  title="不合格批次（批号）">不合格批次（批号）</label>
                        <div class="layui-input-block qbdms-input">
                            <input type="text" name="unqualifiedBatch"  placeholder="请输入"
                                   autocomplete="off" class="layui-input textInput"
                                   maxlength="50" fieldname="unqualifiedBatch">
                        </div>
                    </div>
                    <div style="width: 50%">
                        <label class="layui-form-label qbdms-label"  title="不合格检测项目">不合格检测项目</label>
                        <div class="layui-input-block qbdms-input">
                            <select name="unqualifiedTestingItems" id="testingItems"
                                    lay-search="" maxlength="50"></select>
                        </div>
                    </div>
                    <div style="width: 42%">
                        <label class="layui-form-label qbdms-label"  title="不合格等级">不合格等级</label>
                        <div class="layui-input-block qbdms-input">
                            <@dicSelect.dic name="unqualifiedGrade" nodeKey="bhgdj" />
                        </div>
                    </div>

                    <div style="width: 76%">
                        <label class="layui-form-label qbdms-label" title="备注">备注</label>
                        <div class="layui-input-block qbdms-input">
                            <textarea  name="remark" rows="2" class="layui-textarea" placeholder="请输入"
                                       autocomplete="off" maxlength="500" fieldname="remark"></textarea>
                        </div>
                    </div>
                </div>

                <div class="layui-hide">
                    <input type="text" name="id" placeholder="请输入"
                           autocomplete="off" class="layui-input " maxlength="50" fieldname="id">
                </div>

                <div class="layui-form-item" style="margin-top: 48px">
                    <p style="text-align: left;margin-left: 145px;">
                    <span id="hideAndShow" style="">
                        <a lay-submit lay-filter="wQbdQualityAnalysisReport" class="layui-btn btn-n privateSubmit qbdms-oneBtn"
                           requrl="${ctx}/qbdms/wQbdFastenerInformation/save">提交</a>
                    </span>
                        <button type="reset" id="closeWindow" style="margin-left: 10px;"
                                class="layui-btn layui-btn-sm btn-save qbdms-oneBtnLine">取消
                        </button>
                    </p>
                </div>
    </form>
        </div>
    </div>
</div>
<script src="${ctx}/qbdmsStatic/public/configFile.js"></script>
<script src="${ctx}/layui/layui.js"></script>
<script>
    layui.config({
        base: serverPath.qbdmsPath + staticPath.qbdmsPath //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index','common','laydate','jquery','propsHandle','qbdmsForm','publicMethods'], function () {
        var laydate = layui.laydate;
        var $ = layui.jquery;
        var form = layui.qbdmsForm;
        var common = layui.common;
        var propsHandle = layui.propsHandle;
        var publicMethods=layui.publicMethods
        var defProps = {
                //viewMould: 'form/formDef/view/formDesign/moulds/', // 组件模块 存放文件 *****
                viewMould: 'moulds/', // 组件模块 存放文件 *****
                selectorBtn: '.selectorBtn'
            },
            temQuery = new propsHandle();  // 实例化模板功能部分
        temQuery.initTem({
            selectorBtn: defProps.selectorBtn,
            selectorTemPath: setter.views + defProps.viewMould
        });
        var dateTimeFiledLen = $(".dateTimeFiled");
        var today=new Date();
        for(var i=0;i<dateTimeFiledLen.length;i++){
            laydate.render({
                elem: dateTimeFiledLen[i] //指定元素
                ,type: 'date'
                ,trigger: 'click'
                ,max: today.toString()
            });
        }

        //关闭当前页面
        $("#closeWindow,.closeWindow").click(function () {
            window.location.href = serverPath.qbdmsPath + '/qbdms/wQbdFastenerInformation/view/list';
        });


        var runId = "${runId}";
        if(runId == null || runId == ''){
            $("#hideAndShow").show();
        }

        var index = parent.layer.getFrameIndex(window.name);
        common.updateForm({
            name:'wQbdFastenerInformationDataForm',
            idValue:"${id}",
            primary:"id",
            getCallback: function (data) {
                initBHGJCXM(data.data.inspectionItemName);
            },
            updateCallback:function (data) {
                if (common.filterRecord(data)) {
                    if($(".privateSubmit")){
                        $(".privateSubmit").attr("disabled",false).css("pointer-events","auto");
                    }
                    layer.alert(publicMethods.confirmStyle(data.msg),{title: false,skin: 'confirm-class'}, function (index) {
                        layer.close(index);
                        window.location.href = serverPath.qbdmsPath + '/qbdms/wQbdFastenerInformation/view/list';
                    });
                } else {
                    layer.alert(publicMethods.confirmStyle(data.msg),{title: false,skin: 'confirm-class'});
                }
                return false;
            }
        });

        // 检验项名称
        var jyxmcDic = eval('${jyxmcDic}');
        common.initDicData("inspectionItemName", jyxmcDic);

        form.on('select(inspectionItemName)', function(data){
            //清空选项
            var options= $("#testingItems option");
            options.remove();
            form.render();
            //根据检验项名称 加载 不合格检测项目
            //var itemKey=data.elem[data.elem.selectedIndex].getAttribute("itemKey");
            //不合格检测项目
            initBHGJCXM(data.value);
        });

        //不合格检测项目
        function initBHGJCXM(itemKey) {
            var bhgjcxmDic="";
            switch (itemKey) {
                case "螺栓":
                    bhgjcxmDic = eval('${lsbhgjcxmDic}');
                    break;
                case "螺母":
                    bhgjcxmDic = eval('${lmbhgjcxmDic}');
                    break;
                case "垫圈":
                    bhgjcxmDic = eval('${dqbhgjcxmDic}');
                    break;
                case "铆钉":
                    bhgjcxmDic = eval('${mdbhgjcxmDic}');
                    break;
                case "其它":
                    bhgjcxmDic = eval('${qtbhgjcxmDic}');
                    break;
                default:
                    break;
            }
            common.initDicData("unqualifiedTestingItems",bhgjcxmDic);
        }
    });

</script>
</body>
</html>